package Template;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 快速排序
 */
public class quickSort {
    public static void main(String[] args) throws IOException {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(bf.readLine());
        int[] arr = new int[N];
        String[] s = bf.readLine().split(" ");
        for (int i=0;i<N;i++){
            arr[i] = Integer.parseInt(s[i]);
        }
        quickSort(arr,0,N-1);
        for (int i=0;i<N;i++){
            System.out.print(arr[i]+" ");
        }
        bf.close();
    }
    private static void quickSort(int[] arr,int left,int right){
        if (left>=right){
            return;
        }
        int l=left-1;
        int r = right+1;
        int mid = arr[l+r>>1];
        while (l<r){
            while (arr[++l]<mid);
            while (arr[--r]>mid);

            if (l<r){
                int temp = arr[l];
                arr[l] = arr[r];
                arr[r] = temp;
            }
        }
        quickSort(arr,0,l);
        quickSort(arr,l+1,r);
    }
}
